<%-- 
    Document   : dodadiPacient
    Created on : 16.5.2011, 20:49:
    Author     : Ruzin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<link rel="stylesheet" type="text/css" href="style.css" />

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Додади Пациент</title>
            <script language="javascript">
                function izvesti(textstring){
                    return alert('Пациентот '+ textstring + ' успешно е внесен');
                }
            </script>
        </head>
        <body>
              <div class="head">
               <div class="text">
                    Добродојдовте на страната на стоматолошката ординација
                    
                </div>
                <div class="logo"></div>
             </div>  
            <% 
            if (request.getSession().getValue("permisija") == null){
                response.sendRedirect("index.jsp?error=true");
            }
            String permisija = request.getSession().getValue("permisija").toString();
            if (permisija.equals("user") || permisija.isEmpty()) {
              response.sendRedirect("user.jsp?error=true");
            }
           // out.println("<h2>"+permisija+"</h2>");
        %>
            <h1><h:outputText value="Страна за додавање на нов пациент"/></h1>
            <form action="dodadiPacient.do" onsubmit="izvesti(ime.value)">
            <table align="center" border="1">
                <tr>
                    <td>ИМЕ:</td>
                    <td><input type="text" name="ime"/></td>
                </tr>
                <tr>
                    <td>ПРЕЗИМЕ:</td>
                    <td><input type="text" name="prezime"/></td>
                </tr>
            </tr>
            <tr>
                <td>ЕМБГ:</td>
                <td><input type="text" name="embg"/></td>
            </tr>
            <tr>
                <td>УЛОГА:</td>
                <td><select name="credential">
                    <option value="user">Пациент</option>
                    <option value="admin">Сестра</option>
                    <option value="admin">Доктор</option>
                    </select></td>
            </tr>
            </table>
                <input type="submit" value="Регистрирај го пациентот"/>
            </form>
            </table>
            <br/>
            <form action="admin.jsp">
                <input type="submit" value="Откажи!"/>
            </form>
            <div class="footer">
                        Copyright Ruzin © 2011
           </div>
        </body>
    </html>
</f:view>
